'use strict';

import request from '@/utils/request';
import { getCookie } from '@/utils/cookie';

export function confirm(id) {
    const csrfToken = getCookie('csrfToken');
    return request({
        method: 'post',
        url: '/confirm',
        data: {
            id,
            confirm: true,
        },
        headers: {
            'x-csrf-token': csrfToken,
        }
    });
}

export function reject(id) {
    const csrfToken = getCookie('csrfToken');
    return request({
        method: 'post',
        url: '/confirm',
        data: {
            id,
            confirm: false,
        },
        headers: {
            'x-csrf-token': csrfToken,
        }
    });
}
